import request from '@/utils/request'



export default{


  getSiteBysitePkId(sitePkId) {
    return request({
      url: `/research/getSiteBysitePkId?sitePkId=${sitePkId}`,
      method: 'get'
    })
  },
  siteAllSearch(pageIndex,pageSize)
  {
    return request({
      url: `/research/searchSite`,
      method: 'post',
      data: {
        pageNum:pageIndex,
        pageSize:pageSize
      }
    })
  },

  siteAllAllSearch(pageIndex,pageSize)
  {
    return request({
      url: `/research/searchAllSite`,
      method: 'post',
      data: {
        pageNum:pageIndex,
        pageSize:pageSize
      }
    })
  },

  addSite(data) {
    return request({
      url: `/site`,
      method: 'post',
      data: {
        FUN_TYPE:1,
        SITE_PK_ID:data.sitePkId,
        SITE_NAME:data.siteName,
        SITE_CODE:data.siteCode,
        PERSON_EMAIL:data.personEmail,
        PERSON_PK_ID:null,
        AGENCY_NAME:data.agencyName,
        AGENCY_CODE:data.agencyCode,
        AGENCY_PK_ID:null,
        SUBJECT_PK_ID:null,
        SUBJECT_NAME:null,
        SUBJECT_CODE:null,
        SUBJECT_JOINNUM:null,
        TYPE:data.type
      }
    })
  },

  updateSite(data) {
    return request({
      url: `/site`,
      method: 'put',
      data: {
        id:data.id,
        sitePkId:data.sitePkId,
        siteName:data.siteName,
        siteCode:data.siteCode,
        personEmail:data.personEmail,
        agencyName:data.agencyName,
        agencyCode:data.agencyCode,
        type:data.type
      }
    })
  },

  deleteSite(id)
  {
    return request({
      url: `/site/delete/${id}`,
      method: 'POST',
    })
  },

}
